#include <bits/stdc++.h>
using namespace std;
using ll = long long int;
const int N = 1E5 + 10;
int n, k;
ll a[N], b[N], asum[N], bsum[N];
int main()
{
    cin >> n >> k;
    for (int i = 1; i <= n; i++)
    {
        cin >> a[i];
    }
    for (int i = 1; i <= n; i++)
    {
        cin >> b[i];
    }
    for (int i = 1; i <= n; i++)
    {
        asum[i] = asum[i - 1] + a[i - 1];
        bsum[i] = bsum[i - 1] + b[i - 1];
    }
    int ans = 1;
    ll maxa = 0;
    ll suma = 0;
    ll sumb = 0;
    ll minb = 1e18;
    for (int left = 1, right = 1; right <= n;)
    {
        suma += a[right];
        sumb += b[right];
        while (right - left + 1 > k)
        {
            suma -= a[left];
            sumb -= b[left++];
        }
        if (right - left + 1 == k)
        {
            
            if (suma > maxa)
            {
                maxa = suma;
                ans = left;
                //就是这个地方如果有更大的suma此时我们的minb就是此时的sumb
                minb=sumb;
            }
            else if (suma == maxa)
            {
                if (sumb < minb)
                {
                    maxa=suma;
                    minb = sumb;
                    ans = left;
                }
            }
        }
        right++;
    }
    cout << ans;

    return 0;
}

#include <bits/stdc++.h>
using namespace std;
using ll = long long int;
const int N = 1E5 + 10;
int n, k;
ll a[N], b[N], asum[N], bsum[N];
int main()
{
    cin >> n >> k;
    for (int i = 1; i <= n; i++)
    {
        cin >> a[i];
    }
    for (int i = 1; i <= n; i++)
    {
        cin >> b[i];
    }
    for (int i = 1; i <= n; i++)
    {
        asum[i] = asum[i - 1] + a[i];
        bsum[i] = bsum[i - 1] + b[i];
       
    }
    int ans = 1;
    ll maxa = 0;
    ll suma = 0;
    ll sumb = 0;
    ll minb = 1e18;
    for(int i=1;i+k-1<=n;i++)
    {
        
        int left=i,right=i+k-1;
        suma=asum[right]-asum[left-1];
        sumb=bsum[right]-bsum[left-1];
        if(suma>maxa)
        {
            ans=i;
            maxa=suma;
            minb=min(minb,sumb);
        }
        else if(suma==maxa)
        {
            if(sumb<minb)
            {
                ans=i;
                minb=sumb;
            }
        }
    }
    cout << ans;

    return 0;
}